/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author maynoigi
 */
@Entity
@Table(name = "Members")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Members.findAll", query = "SELECT m FROM Members m"),
    @NamedQuery(name = "Members.findByMembersID", query = "SELECT m FROM Members m WHERE m.membersID = :membersID"),
    @NamedQuery(name = "Members.findByMembersName", query = "SELECT m FROM Members m WHERE m.membersName = :membersName"),
    @NamedQuery(name = "Members.findByMembersUser", query = "SELECT m FROM Members m WHERE m.membersUser = :membersUser"),
    @NamedQuery(name = "Members.findByMembersGender", query = "SELECT m FROM Members m WHERE m.membersGender = :membersGender"),
    @NamedQuery(name = "Members.findByMembersAddress", query = "SELECT m FROM Members m WHERE m.membersAddress = :membersAddress"),
    @NamedQuery(name = "Members.findByMembersPhone", query = "SELECT m FROM Members m WHERE m.membersPhone = :membersPhone"),
    @NamedQuery(name = "Members.findByMembersPassword", query = "SELECT m FROM Members m WHERE m.membersPassword = :membersPassword"),
    @NamedQuery(name = "Members.findByMembersPosition", query = "SELECT m FROM Members m WHERE m.membersPosition = :membersPosition"),
    @NamedQuery(name = "Members.findByMembersRole", query = "SELECT m FROM Members m WHERE m.membersRole = :membersRole")})
public class Members implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "MembersID")
    private Integer membersID;
    @Size(max = 200)
    @Column(name = "MembersName")
    private String membersName;
    @Size(max = 200)
    @Column(name = "MembersUser")
    private String membersUser;
    @Size(max = 50)
    @Column(name = "MembersGender")
    private String membersGender;
    @Size(max = 300)
    @Column(name = "MembersAddress")
    private String membersAddress;
    @Size(max = 200)
    @Column(name = "MembersPhone")
    private String membersPhone;
    @Size(max = 200)
    @Column(name = "MembersPassword")
    private String membersPassword;
    @Size(max = 200)
    @Column(name = "MembersPosition")
    private String membersPosition;
    @Column(name = "MembersRole")
    private Integer membersRole;
    @OneToMany(mappedBy = "complaintTechnical")
    private Collection<Complaint> complaintCollection;
    @OneToMany(mappedBy = "membersID")
    private Collection<Complaint> complaintCollection1;
    @JoinColumn(name = "DepartmentID", referencedColumnName = "DepartmentID")
    @ManyToOne
    private Department departmentID;
    @OneToMany(mappedBy = "membersID")
    private Collection<Solution> solutionCollection;

    public Members() {
    }

    public Members(Integer membersID) {
        this.membersID = membersID;
    }

    public Integer getMembersID() {
        return membersID;
    }

    public void setMembersID(Integer membersID) {
        this.membersID = membersID;
    }

    public String getMembersName() {
        return membersName;
    }

    public void setMembersName(String membersName) {
        this.membersName = membersName;
    }

    public String getMembersUser() {
        return membersUser;
    }

    public void setMembersUser(String membersUser) {
        this.membersUser = membersUser;
    }

    public String getMembersGender() {
        return membersGender;
    }

    public void setMembersGender(String membersGender) {
        this.membersGender = membersGender;
    }

    public String getMembersAddress() {
        return membersAddress;
    }

    public void setMembersAddress(String membersAddress) {
        this.membersAddress = membersAddress;
    }

    public String getMembersPhone() {
        return membersPhone;
    }

    public void setMembersPhone(String membersPhone) {
        this.membersPhone = membersPhone;
    }

    public String getMembersPassword() {
        return membersPassword;
    }

    public void setMembersPassword(String membersPassword) {
        this.membersPassword = membersPassword;
    }

    public String getMembersPosition() {
        return membersPosition;
    }

    public void setMembersPosition(String membersPosition) {
        this.membersPosition = membersPosition;
    }

    public Integer getMembersRole() {
        return membersRole;
    }

    public void setMembersRole(Integer membersRole) {
        this.membersRole = membersRole;
    }

    @XmlTransient
    public Collection<Complaint> getComplaintCollection() {
        return complaintCollection;
    }

    public void setComplaintCollection(Collection<Complaint> complaintCollection) {
        this.complaintCollection = complaintCollection;
    }

    @XmlTransient
    public Collection<Complaint> getComplaintCollection1() {
        return complaintCollection1;
    }

    public void setComplaintCollection1(Collection<Complaint> complaintCollection1) {
        this.complaintCollection1 = complaintCollection1;
    }

    public Department getDepartmentID() {
        return departmentID;
    }

    public void setDepartmentID(Department departmentID) {
        this.departmentID = departmentID;
    }

    @XmlTransient
    public Collection<Solution> getSolutionCollection() {
        return solutionCollection;
    }

    public void setSolutionCollection(Collection<Solution> solutionCollection) {
        this.solutionCollection = solutionCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (membersID != null ? membersID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Members)) {
            return false;
        }
        Members other = (Members) object;
        if ((this.membersID == null && other.membersID != null) || (this.membersID != null && !this.membersID.equals(other.membersID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Members[ membersID=" + membersID + " ]";
    }
    
}
